#region Using

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Text;
using System.Globalization;
using BlogEngine.Core;
using BlogEngine.Core.Provider;
using BlogEngine.Core.Provider.Interfaces;

#endregion

namespace BlogEngine.Core.Provider.MSSQL
{
	/// <summary>
	/// A storage provider for BlogEngine that uses XML files.
	/// <remarks>
	/// To build another provider, you can just copy and modify
	/// this one. Then add it to the web.config's BlogEngine section.
	/// </remarks>
	/// </summary>
	public class CIPostContent : IPostContent
	{
		/// <summary>
		/// Retrieves the content of the post in order to lazy load.
		/// </summary>
		/// <param name="id"></param>
		/// <returns></returns>
        public string SelectPostContent(Guid id)
        {
			SQLManagedConnection myConn = new SQLManagedConnection(Provider.DatabaseName);
            myConn.GetTextCommand("SELECT PostContent FROM be_Posts WHERE PostID = @id");
            myConn.AddInParameter("@id",DbType.Guid,id);
			return myConn.ExecuteScalar() as string;
        }
    }
}